package xyz.ddlnt.serviceusr.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import xyz.ddlnt.model.dto.PageDTO;
import xyz.ddlnt.model.entity.PostHistoryRecord;
import xyz.ddlnt.model.vo.PostRecordVO;
import xyz.ddlnt.serviceusr.mapper.PostHistoryRecordMapper;
import xyz.ddlnt.serviceusr.service.PostHistoryRecordService;

import java.util.List;

/**
 * @author ZZULI_SE 210910
 * @data 2025/5/25 21:50
 */
@Service
public class PostHistoryRecordServiceImpl extends ServiceImpl<PostHistoryRecordMapper, PostHistoryRecord> implements PostHistoryRecordService {
    @Resource
    private PostHistoryRecordMapper postHistoryRecordMapper;

    @Override
    public List<PostRecordVO> getPostHistoryRecordList(PageDTO pageDTO) {
        IPage<PostRecordVO> page = new Page<>(pageDTO.getPageNum(), pageDTO.getPageSize());
        return postHistoryRecordMapper.getPostHistoryRecordList(page, pageDTO.getId());
    }
}
